home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2001 / MacHack 2001.toast / pc / The Hacks / The Weakest Link / source / OpenTptEnet / CIncludes / EnetLib.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-06-23  |  36.5 KB  |  1,121 lines

  1. /*
  2.     File:        EnetLib.h
  3.  
  4.     Contains:    Ethernet includes
  5.  
  6.     Version:    1.0.0
  7.  
  8.     Copyright:    © 1997-1998 by Apple Computer, Inc., all rights reserved.
  9.  
  10. */
  11.  
  12. #ifndef __ENETLIB_H__
  13. #define __ENETLIB_H__
  14.  
  15. #include "EnetUser.h"
  16.  
  17. #ifndef __ENETWARTS_H__
  18. #define __ENETWARTS_H__
  19.  
  20. /******************************************************************************/
  21.  
  22. // The default ForROM is OFF.
  23. #ifndef ForROM
  24. #define ForROM 0
  25. #endif
  26.  
  27. // #if DEBUG => ASSERT=ON
  28. // #if ASSERT => assert() enabled
  29.  
  30. //#define DEBUG 1
  31.  
  32. // The default DEBUG is OFF.
  33. #ifndef DEBUG
  34. #define DEBUG 0
  35. #endif
  36.  
  37. #if DEBUG
  38. // If DEBUG is ON, force ASSERT to ON.
  39. #undef ASSERT
  40. #define ASSERT 1
  41. #endif
  42.  
  43. // The default ASSERT is OFF.
  44. #ifndef ASSERT
  45. #define ASSERT 0
  46. #endif
  47.  
  48. extern Boolean gEnetLibDebug;    // If true, TPrintf() does DPuts()
  49. extern Boolean gEnetLibError;    // If true, EPrintf() does DPuts()
  50.  
  51. // Determine default values for gEnetLibDebug and gEnetLibError.
  52. #if DEBUG
  53. #define kDefaultEnetLibDebug true
  54. #else
  55. #define kDefaultEnetLibDebug false
  56. #endif
  57. #if ASSERT
  58. #define kDefaultEnetLibError true
  59. #else
  60. #define kDefaultEnetLibError false
  61. #endif
  62.  
  63. // Eliminate DPrintf, TPrintf() and EPrintf() code if ForROM and not DEBUG.
  64. #if DEBUG
  65. #define DPRINTF 1
  66. #define TPRINTF 1
  67. #define EPRINTF 1
  68. #else
  69. #if ForROM
  70. #define DPRINTF 0
  71. #define TPRINTF 0
  72. #define EPRINTF 0
  73. #else
  74. #define DPRINTF 1
  75. #define TPRINTF 1
  76. #define EPRINTF 1
  77. #endif
  78. #endif
  79.  
  80. /******************************************************************************/
  81.  
  82. // Allocate a static gSourceVersion from kSourceVersion.
  83. // Modify to indicate DEBUG/ASSERT with compile data and time.
  84. #ifdef kSourceVersion
  85. #if DEBUG
  86. static const char *gSourceVersion = kSourceVersion"D "__DATE__" "__TIME__;
  87. #else
  88. #if ASSERT
  89. static const char *gSourceVersion = kSourceVersion"A "__DATE__" "__TIME__;
  90. #else
  91. static const char *gSourceVersion = kSourceVersion" "__DATE__" "__TIME__;
  92. #endif
  93. #endif
  94. #undef kSourceVersion
  95. #endif
  96.  
  97. /******************************************************************************/
  98.  
  99. #if MACOS || WDISK
  100.  
  101. // MACOS INCLUDES FOR WARTS MODULE
  102.  
  103. /******************************************************************************/
  104.  
  105. #pragma    options align=power
  106.  
  107. #include <stdarg.h>
  108. #include <DriverServices.h>
  109. #include <PCI.h>
  110. #include <Interrupts.h>
  111. #include <Memory.h>
  112.  
  113. #define strncpy CStrNCopy
  114.  
  115. typedef UInt32 Timeout;
  116. typedef UInt32 Count;
  117.  
  118. /******************************************************************************/
  119.  
  120. #define kVersionOneDriverDescriptor kInitialDriverDescriptor
  121.  
  122. #define development developStage
  123. #define alpha alphaStage
  124. #define beta betaStage
  125. #define final finalStage
  126.  
  127. /******************************************************************************/
  128.  
  129. // Delay50Nanoseconds() delays for 50 nanoseconds.
  130. static Nanoseconds _Delay50Nanoseconds = {0, 50};
  131. #define Delay50Nanoseconds() \
  132.     DelayForHardware(NanosecondsToAbsolute(_Delay50Nanoseconds))
  133.  
  134. // Delay100Nanoseconds() delays for 100 nanoseconds.
  135. static Nanoseconds _Delay100Nanoseconds = {0, 100};
  136. #define Delay100Nanoseconds() \
  137.     DelayForHardware(NanosecondsToAbsolute(_Delay100Nanoseconds))
  138.  
  139. // Delay150Nanoseconds() delays for 150 nanoseconds.
  140. static Nanoseconds _Delay150Nanoseconds = {0, 150};
  141. #define Delay150Nanoseconds() \
  142.     DelayForHardware(NanosecondsToAbsolute(_Delay150Nanoseconds))
  143.  
  144. // Delay200Nanoseconds() delays for 200 nanoseconds.
  145. static Nanoseconds _Delay200Nanoseconds = {0, 200};
  146. #define Delay200Nanoseconds() \
  147.     DelayForHardware(NanosecondsToAbsolute(_Delay200Nanoseconds))
  148.  
  149. // Delay250Nanoseconds() delays for 250 nanoseconds.
  150. static Nanoseconds _Delay250Nanoseconds = {0, 250};
  151. #define Delay250Nanoseconds() \
  152.     DelayForHardware(NanosecondsToAbsolute(_Delay250Nanoseconds))
  153.  
  154. // Delay5Microseconds() delays for 5 microseconds.
  155. #define Delay5Microseconds() \
  156.     DelayForHardware(DurationToAbsolute(-5))
  157.  
  158. // Delay50Microseconds() delays for 50 microseconds.
  159. #define Delay50Microseconds() \
  160.     DelayForHardware(DurationToAbsolute(-50))
  161.  
  162. // Delay250Microseconds() delays for 250 microseconds.
  163. #define Delay250Microseconds() \
  164.     DelayForHardware(DurationToAbsolute(-250))
  165.  
  166. // Delay10Milliseconds() delays for 10 milliseconds.
  167. #define Delay10Milliseconds() \
  168.     DelayForHardware(DurationToAbsolute(10))
  169.  
  170. /******************************************************************************/
  171.  
  172. #define Runtime    AbsoluteTime
  173.  
  174. // StartRuntime() returns the runtime NOW.
  175. #define StartRuntime()                                                    \
  176.     UpTime()
  177.  
  178. // RuntimeEnter() at the beginning of a function collects runtime statistics.
  179. #define RuntimeEnter(statePtr, function)                                \
  180.     Runtime _runtime_ = StartRuntime();                                    \
  181.     (statePtr)->runtime.function##_count++
  182.  
  183. // RuntimeExit() at the end of a function collects runtime statistics.
  184. #define RuntimeExit(statePtr, function)                                    \
  185.     _runtime_ = SubAbsoluteFromAbsolute(UpTime(), _runtime_);            \
  186.     (statePtr)->runtime.function##_total.lo += _runtime_.lo;            \
  187.     if (_runtime_.lo > (statePtr)->runtime.function##_max.lo) {         \
  188.         (statePtr)->runtime.function##_max.lo = _runtime_.lo;             \
  189.         if (!(statePtr)->runtime.function##_min.lo)                     \
  190.             (statePtr)->runtime.function##_min.lo = _runtime_.lo;         \
  191.     }                                                                     \
  192.     else if (_runtime_.lo < (statePtr)->runtime.function##_min.lo)         \
  193.         (statePtr)->runtime.function##_min.lo = _runtime_.lo;             \
  194.  
  195. // RuntimeCount() is how many times the function has been called.
  196. #define RuntimeCount(statePtr, function)                                \
  197.     (statePtr)->runtime.function##_count
  198.  
  199. // RuntimeTotal() is the total runtime for the function.
  200. #define RuntimeTotal(statePtr, function)                                \
  201.     (statePtr)->runtime.function##_total
  202.  
  203. // RuntimeMinimum() is the minimum runtime for the function.
  204. #define RuntimeMinimum(statePtr, function)                                \
  205.     (statePtr)->runtime.function##_min
  206.  
  207. // RuntimeAverage() is the average runtime for the function.
  208. #define RuntimeAverage(statePtr, function)                                \
  209.     DurationToAbsolute(                                                    \
  210.         AbsoluteToDuration(RuntimeTotal(statePtr, function)) /            \
  211.             (SInt32)RuntimeCount(statePtr, function))
  212.  
  213. // RuntimeMaximum() is the maximum runtime for the function.
  214. #define RuntimeMaximum(statePtr, function)                                \
  215.     (statePtr)->runtime.function##_max
  216.  
  217. /******************************************************************************/
  218.  
  219. #define kEthernetPROMProperty    "local-mac-address"
  220. #define kNameProperty            "name"
  221.  
  222. // RegistryFreeProperty() deallocates a registry property.
  223. // Returns NULL.
  224. // The property must have been allocated by RegisteryFindProperty().
  225. extern void *RegistryFreeProperty(void *x);
  226.  
  227. // RegistryFindProperty() finds a property in the name registery.
  228. // It allocates memory for the propery, see RegistryFreeProperty().
  229. // Returns NULL if there was an error.
  230. extern void *
  231.     RegistryFindProperty(RegEntryIDPtr theID,
  232.                          char *propName,
  233.                          RegPropertyValueSize *propSize);
  234.  
  235. // RegistryGetSlotName() finds the name and slot in the name registery.
  236. // Returns a pointer to a static character buffer.
  237. extern char *RegistryGetSlotName(RegEntryIDPtr theID);
  238.  
  239. /******************************************************************************/
  240.  
  241. #endif // MACOS
  242.  
  243. #if MACH3
  244.  
  245. // MACH 3.0 INCLUDES FOR WARTS MODULE
  246.  
  247. /******************************************************************************/
  248.  
  249. #include <kern/time_out.h>
  250. #include <device/device_types.h>
  251. #include <device/ds_routines.h>
  252. #include <device/errno.h>
  253. #include <device/io_req.h>
  254. #include <device/if_hdr.h>
  255. #include <device/if_ether.h>
  256. #include <device/net_status.h>
  257. #include <device/net_io.h>
  258. #include <chips/busses.h>
  259.  
  260. /******************************************************************************/
  261.  
  262. // Delay50Nanoseconds() delays for 50 nanoseconds.
  263. #define Delay50Nanoseconds()                    *unimplemented*
  264.  
  265. // Delay100Nanoseconds() delays for 100 nanoseconds.
  266. #define Delay100Nanoseconds()                    *unimplemented*
  267.  
  268. // Delay150Nanoseconds() delays for 150 nanoseconds.
  269. #define Delay150Nanoseconds()                    *unimplemented*
  270.  
  271. // Delay200Nanoseconds() delays for 200 nanoseconds.
  272. #define Delay200Nanoseconds()                    *unimplemented*
  273.  
  274. // Delay250Nanoseconds() delays for 250 nanoseconds.
  275. #define Delay250Nanoseconds()                    *unimplemented*
  276.  
  277. // Delay5Microseconds() delays for 5 microseconds.
  278. #define Delay5Microseconds()                    *unimplemented*
  279.  
  280. // Delay50Microseconds() delays for 50 microseconds.
  281. #define Delay50Microseconds()                    *unimplemented*
  282.  
  283. // Delay250Microseconds() delays for 250 microseconds.
  284. #define Delay250Microseconds()                    *unimplemented*
  285.  
  286. // Delay10Milliseconds() delays for 10 milliseconds.
  287. #define Delay10Milliseconds()                    *unimplemented*
  288.  
  289. /******************************************************************************/
  290.  
  291. #define Runtime                                    *unimplemented*
  292.  
  293. // StartRuntime() returns the runtime NOW.
  294. #define StartRuntime()                            *unimplemented*
  295.  
  296. // RuntimeEnter() at the beginning of a function collects runtime statistics.
  297. #define RuntimeEnter(statePtr, function)        *unimplemented*
  298.  
  299. // RuntimeExit() at the end of a function collects runtime statistics.
  300. #define RuntimeExit(statePtr, function)            *unimplemented*
  301.  
  302. // RuntimeCount() is how many times the function has been called.
  303. #define RuntimeCount(statePtr, function)        *unimplemented*
  304.  
  305. // RuntimeTotal() is the total runtime for the function.
  306. #define RuntimeTotal(statePtr, function)        *unimplemented*
  307.  
  308. // RuntimeMinimum() is the minimum runtime for the function.
  309. #define RuntimeMinimum(statePtr, function)        *unimplemented*
  310.  
  311. // RuntimeAverage() is the average runtime for the function.
  312. #define RuntimeAverage(statePtr, function)        *unimplemented*
  313.  
  314. // RuntimeMaximum() is the maximum runtime for the function.
  315. #define RuntimeMaximum(statePtr, function)        *unimplemented*
  316.  
  317. /******************************************************************************/
  318.  
  319. #endif // MACH3
  320.  
  321. /******************************************************************************/
  322.  
  323. // DeallocateMemory() deallocates general purpose memory.
  324. // Returns NULL.
  325. // The memory will be zeroed if a size > 0 is specified.
  326. // The memory must have been allocated with AllocateMemory().
  327. extern void *DeallocateMemory(void *x, Size);
  328.  
  329. // AllocateMemory() allocates general purpose memory.
  330. // Returns NULL if there was an error.
  331. extern void *AllocateMemory(Size, Boolean zero);
  332.  
  333. /******************************************************************************/
  334.  
  335. // _Printf() formats an output character stream.
  336. // Returns the number of characters output.
  337. // Returns -1 if there was an error.
  338. extern int _Printf(void *, int (*)(int, void *), const char *, va_list);
  339.  
  340. /******************************************************************************/
  341.  
  342. typedef struct BPrintfBuffer    BPrintfBuffer;
  343. typedef BPrintfBuffer *            BPrintfBufferPtr;
  344. struct BPrintfBuffer {
  345.     char *                        begin;    // &buffer[0]
  346.     char *                        end;    // &buffer[size]
  347.     char *                        next;    // &buffer[nextPutc]
  348. };
  349. typedef BPrintfBufferPtr        BPrintfPtr;
  350.  
  351. // BPrintfPutc() is the putc routine used by _BPrintf().
  352. // Returns zero.
  353. // Returns -1 if there was an error.
  354. // It does not NULL-terminate the buffer.
  355. extern int BPrintfPutc(int c, void *output);
  356.  
  357. // ResetBPrintf() prepares a BPrintfBuffer.
  358. extern void ResetBPrintf(BPrintfPtr, char *, Size);
  359.  
  360. // CheckBPrintf() checks for a minimum free space.
  361. // Returns false if there was an error.
  362. Boolean CheckBPrintf(BPrintfPtr b, Count minFree);
  363.  
  364. // _BPrintf() is a varargs version of BPrintf().
  365. // Returns the number of characters output.
  366. // Returns -1 if there was an error.
  367. // It can not step outside of its buffer.
  368. extern int _BPrintf(BPrintfPtr, const char *, va_list);
  369.  
  370. // BPrintf() is used like sprintf().
  371. // Returns the number of characters output.
  372. // Returns -1 if there was an error.
  373. // It can not step outside of its buffer, unlike sprintf().
  374. extern int BPrintf(BPrintfPtr, const char *, ...);
  375.  
  376. /******************************************************************************/
  377.  
  378. // _SPrintf() is a varargs version of SPrintf().
  379. // Returns the number of characters output.
  380. // Returns -1 if there was an error.
  381. // It can not step outside of its buffer.
  382. extern int _SPrintf(char *, Size, const char *, va_list);
  383.  
  384. // SPrintf() is a safe version of sprintf().
  385. // Returns the number of characters output.
  386. // Returns -1 if there was an error.
  387. // It can not step outside of its buffer, unlike sprintf().
  388. extern int SPrintf(char *, Size,  const char *,  ...);
  389.  
  390. /******************************************************************************/
  391.  
  392. // DPuts() displays a message then enters the debugger.
  393. extern void DPuts(const char *);
  394.  
  395. // DPrintf() formats and displays a message then enters the debugger.
  396. extern void _DPrintf(const char *, ...);
  397. #if DPRINTF
  398. #define DPrintf(args) _DPrintf##args
  399. #else
  400. #define DPrintf(args)
  401. #endif
  402.  
  403. // _assert() enters the debugger when an assertion fails.
  404. extern int _assert(const char *, const int, const char *);
  405.  
  406. #if ASSERT
  407. // Save some space with assert().
  408. // Put these two lines at the top of each source file.
  409. //   #define kAssertFile __FILE__
  410. //   static const char *gAssertFile = kAssertFile;
  411. #ifdef kAssertFile
  412. #undef assert
  413. #define assert(x) ((void)((x) ? 0 : _assert(gAssertFile, __LINE__, #x), 1))
  414. #else
  415. #undef assert
  416. #define assert(x) ((void)((x) ? 0 : _assert(__FILE__, __LINE__, #x), 1))
  417. #endif
  418. #else
  419. #undef assert
  420. #define assert(x)
  421. #endif
  422.  
  423. /******************************************************************************/
  424.  
  425. typedef struct MPrintfBuffer    MPrintfBuffer;
  426. typedef MPrintfBuffer *            MPrintfBufferPtr;
  427. typedef MPrintfBufferPtr        MPrintfPtr;
  428.  
  429. // CloseMPrintf() terminates access to an error buffer.
  430. // Returns NULL.
  431. // This invalidates the MPrintfBuffer pointer.
  432. extern MPrintfPtr CloseMPrintf(MPrintfPtr);
  433.  
  434. // ResetMPrintf() clears and resets a MPrintfBuffer.
  435. extern void ResetMPrintf(MPrintfPtr m);
  436.  
  437. // OpenMPrintf() prepares a MPrintfBuffer of the specified size.
  438. // Returns NULL if there was an error.
  439. extern MPrintfPtr OpenMPrintf(Size);
  440.  
  441. // MPuts() inserts a message into an MPrintfBuffer.
  442. // Use '\n' between messages lines.
  443. extern void MPuts(MPrintfPtr, const char *);
  444.  
  445. // MPrintf() formats and inserts a message into an MPrintfBuffer.
  446. // Use '\n' between messages lines.
  447. extern void MPrintf(MPrintfPtr, const char *, ...);
  448.  
  449. // ReadMPrintfLine() extracts a single line from the MPrintfBuffer.
  450. extern void ReadMPrintfLine(BPrintfPtr output, MPrintfPtr m, char *line);
  451.  
  452. // ReadMPrintfBuffer() extracts MPrintfBuffer lines in reverse order.
  453. // Returns false if there was an error.
  454. extern Boolean ReadMPrintfBuffer(BPrintfPtr, MPrintfPtr, Count);
  455.  
  456. /******************************************************************************/
  457.  
  458. // TPrintf() formats a trace message.
  459. // The message is inserted into the MPrintf buffer if one is specified.
  460. // It will DPuts() if DEBUG is defined non-zero.
  461. extern void _TPrintf(MPrintfPtr m, const char *format, ...);
  462. #if TPRINTF
  463. #define TPrintf(args) _TPrintf##args
  464. #else
  465. #define TPrintf(args)
  466. #endif
  467.  
  468. /******************************************************************************/
  469.  
  470. // EPrintf() formats an error message.
  471. // The message is inserted into the MPrintf buffer if one is specified.
  472. // It will DPuts() if ASSERT is defined non-zero.
  473. extern void _EPrintf(MPrintfPtr, const char *, ...);
  474. #if EPRINTF
  475. #define EPrintf(args) _EPrintf##args
  476. #else
  477. #define EPrintf(args)
  478. #endif
  479.  
  480. // ECheckUInt8() checks two numbers.
  481. // Does EPrintf and returns false if they are not the same.
  482. extern Boolean ECheckUInt8(MPrintfPtr, UInt8, UInt8, const char *, ...);
  483.  
  484. // ECheckUInt16() checks two numbers.
  485. // Does EPrintf and returns false if they are not the same.
  486. extern Boolean ECheckUInt16(MPrintfPtr, UInt16, UInt16, const char *, ...);
  487.  
  488. // ECheckUInt32() checks two numbers.
  489. // Does EPrintf and returns false if they are not the same.
  490. extern Boolean ECheckUInt32(MPrintfPtr, UInt32, UInt32, const char *, ...);
  491.  
  492. // ECheckSInt32() checks two numbers.
  493. // Does EPrintf and returns false if they are not the same.
  494. extern Boolean ECheckSInt32(MPrintfPtr, SInt32, SInt32, const char *, ...);
  495.  
  496. // ECheckUInt8Range() checks a number against a range.
  497. // Does EPrintf and returns false if the number is out of range.
  498. extern Boolean
  499.     ECheckUInt8Range(MPrintfPtr, UInt8, UInt8, UInt8, const char *, ...);
  500.  
  501. // ECheckUInt16Range() checks a number against a range.
  502. // Does EPrintf and returns false if the number is out of range.
  503. extern Boolean
  504.     ECheckUInt16Range(MPrintfPtr, UInt16, UInt16, UInt16, const char *, ...);
  505.  
  506. // ECheckUInt32Range() checks a number against a range.
  507. // Does EPrintf and returns false if the number is out of range.
  508. extern Boolean
  509.     ECheckUInt32Range(MPrintfPtr, UInt32, UInt32, UInt32, const char *, ...);
  510.  
  511. // ECheckUInt32() checks two pointers.
  512. // Does EPrintf and returns false if they do not match.
  513. extern Boolean ECheckPtr(MPrintfPtr, void *, void *, const char *, ...);
  514.  
  515. // ECheckNullPtr() checks for a null pointer.
  516. // Does EPrintf and returns false if the pointer is null.
  517. extern Boolean ECheckNullPtr(MPrintfPtr, void *, const char *, ...);
  518.  
  519. /******************************************************************************/
  520.  
  521. // Delay50Nanoseconds() delays for 50 nanoseconds.
  522. // Error if Delay50Nanoseconds() not defined by OS-specific code.
  523. #ifndef Delay50Nanoseconds
  524. #define Delay50Nanoseconds()                    *unimplemented*
  525. #endif
  526.  
  527. // Delay100Nanoseconds() delays for 100 nanoseconds.
  528. // Error if Delay100Nanoseconds() not defined by OS-specific code.
  529. #ifndef Delay100Nanoseconds
  530. #define Delay100Nanoseconds()                    *unimplemented*
  531. #endif
  532.  
  533. // Delay150Nanoseconds() delays for 150 nanoseconds.
  534. // Error if Delay150Nanoseconds() not defined by OS-specific code.
  535. #ifndef Delay150Nanoseconds
  536. #define Delay150Nanoseconds()                    *unimplemented*
  537. #endif
  538.  
  539. // Delay200Nanoseconds() delays for 200 nanoseconds.
  540. // Error if Delay200Nanoseconds() not defined by OS-specific code.
  541. #ifndef Delay200Nanoseconds
  542. #define Delay200Nanoseconds()                    *unimplemented*
  543. #endif
  544.  
  545. // Delay250Nanoseconds() delays for 250 nanoseconds.
  546. // Error if Delay250Nanoseconds() not defined by OS-specific code.
  547. #ifndef Delay250Nanoseconds
  548. #define Delay250Nanoseconds()                    *unimplemented*
  549. #endif
  550.  
  551. // Delay5Microseconds() delays for 5 microseconds.
  552. // Error if Delay5Microseconds() not defined by OS-specific code.
  553. #ifndef Delay5Microseconds
  554. #define Delay5Microseconds()                    *unimplemented*
  555. #endif
  556.  
  557. // Delay50Microseconds() delays for 50 microseconds.
  558. // Error if Delay50Microseconds() not defined by OS-specific code.
  559. #ifndef Delay50Microseconds
  560. #define Delay50Microseconds()                    *unimplemented*
  561. #endif
  562.  
  563. // Delay250Microseconds() delays for 250 microseconds.
  564. // Error if Delay250Microseconds() not defined by OS-specific code.
  565. #ifndef Delay250Microseconds
  566. #define Delay250Microseconds()                    *unimplemented*
  567. #endif
  568.  
  569. // Delay10Milliseconds() delays for 10 milliseconds.
  570. // Error if Delay10Milliseconds() not defined by OS-specific code.
  571. #ifndef Delay10Milliseconds
  572. #define Delay10Milliseconds()                    *unimplemented*
  573. #endif
  574.  
  575. /******************************************************************************/
  576.  
  577. // Error if Runtime not defined by OS-specific code.
  578. #ifndef Runtime
  579. #define Runtime                                    *unimplemented*
  580. #endif
  581.  
  582. // StartRuntime() returns the runtime NOW.
  583. // Error if StartRuntime() not defined by OS-specific code.
  584. #ifndef StartRuntime
  585. #define StartRuntime()                            *unimplemented*
  586. #endif
  587.  
  588. // Delay for a minimum number of microseconds.
  589. // Returns false if no delay.
  590. extern Boolean RuntimeDelay(Runtime *lastTime, UInt32 microseconds);
  591.  
  592. // RuntimeDelta() returns a runtime delta in microseconds.
  593. extern UInt32 RuntimeDelta(Runtime before, Runtime after);
  594.  
  595. // ElapsedRuntime() returns the number of microseconds since the startTime.
  596. extern UInt32 ElapsedRuntime(Runtime);
  597.  
  598. // RuntimeToString() formats an Runtime value into a string buffer.
  599. // Returns a pointer to a single static string buffer.
  600. extern char *RuntimeToString(Runtime);
  601.  
  602. // RuntimeEnter() at the beginning of a function collects runtime statistics.
  603. // Error if RuntimeEnter() not defined by OS-specific code.
  604. #ifndef RuntimeEnter
  605. #define RuntimeEnter(statePtr, function)        *unimplemented*
  606. #endif
  607.  
  608. // RuntimeExit() at the end of a function collects runtime statistics.
  609. // Error if RuntimeExit() not defined by OS-specific code.
  610. #ifndef RuntimeExit
  611. #define RuntimeExit(statePtr, function)            *unimplemented*
  612. #endif
  613.  
  614. // RuntimeCount() is how many times the function has been called.
  615. // Error if RuntimeCount() not defined by OS-specific code.
  616. #ifndef RuntimeCount
  617. #define RuntimeCount(statePtr, function)        *unimplemented*
  618. #endif
  619.  
  620. // RuntimeTotal() is the total runtime for the function.
  621. // Error if RuntimeTotal() not defined by OS-specific code.
  622. #ifndef RuntimeTotal
  623. #define RuntimeTotal(statePtr, function)        *unimplemented*
  624. #endif
  625.  
  626. // RuntimeMinimum() is the minimum runtime for the function.
  627. // Error if RuntimeMinimum() not defined by OS-specific code.
  628. #ifndef RuntimeMinimum
  629. #define RuntimeMinimum(statePtr, function)        *unimplemented*
  630. #endif
  631.  
  632. // RuntimeAverage() is the average runtime for the function.
  633. // Error if RuntimeAverage() not defined by OS-specific code.
  634. #ifndef RuntimeAverage
  635. #define RuntimeAverage(statePtr, function)        *unimplemented*
  636. #endif
  637.  
  638. // RuntimeMaximum() is the maximum runtime for the function.
  639. // Error if RuntimeMaximum() not defined by OS-specific code.
  640. #ifndef RuntimeMaximum
  641. #define RuntimeMaximum(statePtr, function)        *unimplemented*
  642. #endif
  643.  
  644. // ClearRuntime() zeros the runtime counters.
  645. #define ClearRuntime(statePtr)                                            \
  646.     BlockZero(&(statePtr)->runtime, sizeof((statePtr)->runtime))
  647.  
  648. // RuntimeFunction() defines runtime fields for a function.
  649. #define RuntimeFunction(function)                                        \
  650.     Count        function##_count;                                        \
  651.     Runtime        function##_total;                                        \
  652.     Runtime        function##_min;                                            \
  653.     Runtime        function##_max                                            \
  654.  
  655. // RuntimeReport() composes a runtime report for a function.
  656. #define RuntimeReport(b, statePtr, function)                            \
  657.     BPrintf(b,                                                            \
  658.             #function" %lu %T, %T, %T, %T\n",                            \
  659.             RuntimeCount(statePtr, function),                            \
  660.             RuntimeTotal(statePtr, function),                            \
  661.             RuntimeMinimum(statePtr, function),                            \
  662.             RuntimeAverage(statePtr, function),                            \
  663.             RuntimeMaximum(statePtr, function))
  664.  
  665. #if !RUNTIME
  666.  
  667. // RuntimeEnter() does nothing if RUNTIME is not defined non-zero.
  668. #undef RuntimeEnter
  669. #define RuntimeEnter(statePtr, function)
  670.  
  671. // RuntimeExit() does nothing if RUNTIME is not defined non-zero.
  672. #undef RuntimeExit
  673. #define RuntimeExit(statePtr, function)
  674.  
  675. #endif
  676.  
  677. /******************************************************************************/
  678.  
  679. // DeallocateMemoryForIO() deallocates I/O memory.
  680. // Returns NULL.
  681. // The memory must have been allocated with AllocateMemoryForIO().
  682. extern void *DeallocateMemoryForIO(void *MemoryForIO, Boolean zero);
  683.  
  684. // AllocateMemoryForIO() allocates I/O memory.
  685. // Returns NULL if there was an error.
  686. extern void *AllocateMemoryForIO(Size size, Boolean zero);
  687.  
  688. // LogicalToPhysical() translates a logical address to a physical address.
  689. extern UInt32 LogicalToPhysical(void *MemoryForIO, void *logical);
  690.  
  691. // LogicalToPhysicalES() translates a logical address to a physical address.
  692. // The physical address is endian swapped.
  693. extern UInt32 LogicalToPhysicalES(void *MemoryForIO, void *logical);
  694.  
  695. /******************************************************************************/
  696.  
  697. typedef struct Interrupt Interrupt;
  698. typedef Interrupt *InterruptPtr;
  699.  
  700. // CloseInterrupt() removes an interrupt service routine.
  701. // The interrupt state pointer is invalidated.
  702. // Returns NULL.
  703. extern InterruptPtr CloseInterrupt(InterruptPtr);
  704.  
  705. // OpenInterrupt() installs an interrupt service routine.
  706. // Returns a pointer to the interrupt state.
  707. // Returns NULL if there was an error.
  708. extern InterruptPtr
  709.     OpenInterrupt(RegEntryIDPtr,
  710.                   int ISTPropertyIndex,
  711.                   InterruptHandler,
  712.                   void *);
  713.  
  714. // EnableInterrupt() enables the specified interrupt.
  715. extern void EnableInterrupt(InterruptPtr);
  716.  
  717. // DisableInterrupt() disables the specified interrupt.
  718. extern void DisableInterrupt(InterruptPtr);
  719.  
  720. /******************************************************************************/
  721.  
  722. // PCIWriteUInt16() writes a UInt16 to the PCI configuration.
  723. // Returns false if there was an error.
  724. extern Boolean PCIWriteUInt16(void *cookie, UInt32 address, UInt16 value);
  725.  
  726. // PCIReadUInt16() reads a UInt16 from the PCI configuration.
  727. // Returns false if there was an error.
  728. extern Boolean PCIReadUInt16(void *cookie, UInt32 address, UInt16 *value);
  729.  
  730. // PCIWriteUInt32() writes a UInt32 to the PCI configuration.
  731. // Returns false if there was an error.
  732. extern Boolean PCIWriteUInt32(void *cookie, UInt32 address, UInt32 value);
  733.  
  734. // PCIReadUInt32() reads a UInt32 from the PCI configuration.
  735. // Returns false if there was an error.
  736. extern Boolean PCIReadUInt32(void *cookie, UInt32 address, UInt32 *value);
  737.  
  738. /******************************************************************************/
  739.  
  740. // Reverse8Bit() reverses the bits in an 8-bit number.
  741. extern UInt8 Reverse8Bit(UInt8);
  742.  
  743. // Reverse32Bit() reverses the bits in an 32-bit number.
  744. extern UInt32 Reverse32Bit(UInt32);
  745.  
  746. // CRC32() computes the 32-bit CRC for a buffer.
  747. extern UInt32 CRC32(UInt8 *, Size);
  748.  
  749. /******************************************************************************/
  750.  
  751. #endif // __ENETWARTS_H__
  752.  
  753. typedef struct Enet                Enet;
  754. typedef Enet *                    EnetPtr;
  755.  
  756. typedef struct EnetMAC            EnetMAC;
  757. typedef EnetMAC *                EnetMACPtr;
  758.  
  759. typedef struct EnetAddressListElement    EnetAddressListElement;
  760. typedef EnetAddressListElement *        EnetAddressListPtr;
  761. struct EnetAddressListElement
  762. {
  763.     EnetAddressListPtr            next;
  764.     EnetAddress                    address;
  765.     UInt8                        _pad[2];
  766. };
  767.  
  768. enum EnetMode
  769. {
  770.     kEnetHalted                    = 0,
  771.     kEnetSynchronousILB            = 1,
  772.     kEnetAsynchronousILB        = 2,
  773.     kEnetSynchronousNLB            = 3,
  774.     kEnetAsynchronousNLB        = 4
  775. };
  776. typedef UInt32                    EnetMode;
  777.  
  778. enum TxBufferState
  779. {
  780.     kTxPacketComplete            = 0,
  781.     kTxPacketDropped            = 1,
  782.     kTxBufferBusy                = 2
  783. };
  784. typedef UInt32                    TxBufferState;
  785.  
  786. enum
  787. {
  788.     TX_CRC_ERROR = DL_CRC_ERROR,
  789.     TX_RUNT_ERROR = DL_RUNT_ERROR,
  790.     TX_FRAMING_ERROR = DL_FRAMING_ERROR
  791. };
  792. typedef UInt32 TxErrorFlags;
  793.  
  794. typedef struct TxBuffer            TxBuffer;
  795. typedef TxBuffer *                TxBufferPtr;
  796. typedef TxBuffer                TxPacket;
  797. typedef TxPacket *                TxPacketPtr;
  798.  
  799. struct TxBuffer
  800. {
  801.     TxBufferPtr                    recycleNext;
  802.     TxBufferPtr *                recycleList;
  803.     TxBufferPtr                    packetNext;
  804.     EnetPtr                        enet;
  805.     UInt8 *                        data;
  806.     UInt32                        phyAddress;
  807.     UInt32                        phyAddressES;
  808.     Count                        allocated;
  809.     Count                        used;
  810.     Count                        packetSize;
  811.     Count                        bufferCount;
  812.     Count                        retryCount;
  813.     TxBufferState                state;
  814.     TxErrorFlags                flags;
  815. };
  816.  
  817. enum {
  818.     RX_NO_ERROR                    = DL_NO_ERROR,
  819.     RX_MAC_ERROR                = DL_MAC_ERROR,
  820.     RX_BAD_802_3_LENGTH            = DL_BAD_802_3_LENGTH,
  821.     RX_FRAMING_ERROR            = DL_FRAMING_ERROR,
  822.     RX_RUNT_ERROR                = DL_RUNT_ERROR,
  823.     RX_CRC_ERROR                = DL_CRC_ERROR,
  824.     RX_ERROR_MASK                = RX_CRC_ERROR | \
  825.                                   RX_RUNT_ERROR | \
  826.                                   RX_FRAMING_ERROR | \
  827.                                   RX_BAD_802_3_LENGTH | \
  828.                                   RX_MAC_ERROR,
  829.     RX_RECONNECT                = 0x00000100
  830. };
  831. typedef UInt32                    RxErrorFlags;
  832.  
  833. typedef struct RxBuffer            RxBuffer;
  834. typedef RxBuffer *                RxBufferPtr;
  835. typedef RxBuffer                RxPacket;
  836. typedef RxPacket *                RxPacketPtr;
  837.  
  838. struct RxBuffer {
  839.     RxBufferPtr                    recycleNext;
  840.     RxBufferPtr *                recycleList;
  841.     RxBufferPtr                    packetNext;
  842.     EnetPtr                        enet;
  843.     UInt8 *                        data;
  844.     UInt32                        phyAddress;
  845.     UInt32                        phyAddressES;
  846.     Count                        allocated;
  847.     Count                        used;
  848.     Count                        packetSize;
  849.     Count                        bufferCount;
  850.     RxErrorFlags                flags;
  851.     Count                        busy;
  852.     UInt32                        misc[4];
  853. };
  854.  
  855. // EnetModeName() returns an EnetMode name string.
  856. extern char *EnetModeName(EnetMode);
  857.  
  858. // EnetAddressCRC() calculates the 32-bit CRC for an ethernet address.
  859. extern UInt32 EnetAddressCRC(EnetAddressPtr);
  860.  
  861. // EnetCheckTxBuffer() checks that a transmit buffer has not been stepped on.
  862. // Returns false if there was an error.
  863. extern Boolean EnetCheckTxBuffer(EnetPtr, TxBufferPtr);
  864.  
  865. // EnetCheckTxPacket() checks that a transmit packet has not been stepped on.
  866. // Returns false if there was an error.
  867. extern Boolean EnetCheckTxPacket(EnetPtr, TxPacketPtr);
  868.  
  869. // EnetTxCheck() checks the transmit buffer pool.
  870. // Returns false if there is an error.
  871. extern Boolean EnetTxCheck(EnetPtr);
  872.  
  873. // EnetReturnTxBuffer() returns a buffer to the transmit buffer pool.
  874. extern void EnetReturnTxBuffer(TxBufferPtr);
  875.  
  876. // EnetGetTxBuffer() gets a buffer from the transmit buffer pool.
  877. // Returns NULL if blocked.
  878. extern TxBufferPtr EnetGetTxBuffer(EnetPtr);
  879.  
  880. // EnetReturnTxPacket() returns a packet to the transmit buffer pool.
  881. // A packet is a list of buffers...
  882. extern void EnetReturnTxPacket(TxPacketPtr);
  883.  
  884. // EnetGetTxPacket() converts packet data to a transmit buffer.
  885. // The data pointer can be NULL.
  886. // Returns a pointer to the TxBuffer list.
  887. // Returns NULL if there was an error.
  888. extern TxPacketPtr EnetGetTxPacket(EnetPtr, void *, Size);
  889.  
  890. // EnetTxUnblock() prepares to unblock the transmitter.
  891. // TxUnblock() is called when enough packets have been sent.
  892. typedef void (*EnetTxUnblockPtr)(void *);
  893. extern void EnetTxUnblock(EnetPtr, EnetTxUnblockPtr, void *cookie);
  894.  
  895. // EnetTxService() recycles TxBuffers from the TxRing.
  896. // Wait for a packet to transmit/timeout if specified.
  897. extern void EnetTxService(EnetPtr, TxPacketPtr wait);
  898.  
  899. // EnetTxPacket() attempts to transmit a normal packet.
  900. // Returns NULL if the packet is accepted to be transmitted or dropped.
  901. // Returns the packet pointer if blocked.
  902. extern TxPacketPtr EnetTxPacket(EnetPtr, TxPacketPtr);
  903.  
  904. // EnetTxBadPacket() attempts to transmit a bad packet.
  905. // Returns NULL if the packet is accepted to be transmitted or dropped.
  906. // Returns the packet pointer if blocked.
  907. extern TxPacketPtr EnetTxBadPacket(EnetPtr, TxPacketPtr, TxErrorFlags);
  908.  
  909. // EnetCheckRxBuffer() checks that a receive buffer has not been stepped on.
  910. // Returns false if there was an error.
  911. extern Boolean EnetCheckRxBuffer(EnetPtr, RxBufferPtr);
  912.  
  913. // EnetCheckRxPacket() checks that a receive packet has not been stepped on.
  914. // Returns false if there was an error.
  915. extern Boolean EnetCheckRxPacket(EnetPtr, RxPacketPtr);
  916.  
  917. // EnetRxCheck() checks the receive buffer pool.
  918. // Returns false if there is an error.
  919. extern Boolean EnetRxCheck(EnetPtr);
  920.  
  921. // EnetReturnRxBuffer() returns an buffer to the receive buffer pool.
  922. extern void EnetReturnRxBuffer(RxBufferPtr);
  923.  
  924. // EnetGetRxBuffer() gets a buffer from the receive buffer pool.
  925. // Returns NULL if blocked.
  926. extern RxBufferPtr EnetGetRxBuffer(EnetPtr);
  927.  
  928. // EnetReturnRxPacket() returns a packet to the receive buffer pool.
  929. // A packet is a list of buffers...
  930. extern void EnetReturnRxPacket(RxPacketPtr);
  931.  
  932. // EnetRxPacket() tries to receive a packet.
  933. // Returns NULL if blocked.
  934. extern RxPacketPtr EnetRxPacket(EnetPtr);
  935.  
  936. // EnetStop() halts the transmit and receive processes.
  937. // Returns false if there was an error.
  938. extern Boolean EnetStop(EnetPtr);
  939.  
  940. // EnetStart() starts the transmit and receive processes.
  941. // Returns false if there was an error. 
  942. // The Modes are:
  943. //     kEnetSynchronousILB       SYNCHRONOUS / LOOPBACK.
  944. //     kEnetAsynchronousILB      ASYNCHRONOUS / LOOPBACK.
  945. //     kEnetSynchronousNLB       SYNCHRONOUS / NO LOOPBACK.
  946. //     kEnetAsynchronousNLB      ASYNCHRONOUS / NO LOOPBACK.
  947. // The timeout is for SYNCHRONOUS receive and transmit.
  948. // The txMaxBuffer is the number of buffers in the transmit pool.
  949. // The txMaxService is the maximum number of buffers that trigger service.
  950. // The txMinUnblock is the maximum number of buffers sent before unblocking.
  951. // The rxMaxBuffer is the number of buffers in the receive pool.
  952. // The rxMinService1 is minimum number of buffers that trigger service.
  953. // The rxMinService2 is minimum number of buffers that trigger service.
  954. // The addressList contains both unicast and multicast addresses.
  955. // The acceptErrors enables error packets to be received.
  956. // The RxISR() is applied to the rxCookie for ASYNCHRONOUS packets.
  957. typedef void (*EnetRxISRPtr)(void *);
  958. extern Boolean
  959.     EnetStart(EnetPtr enet,
  960.               EnetMode mode,
  961.               Count timeout,
  962.               Count txMaxBuffer,
  963.               Count txMaxService,
  964.               Count txMinUnblock,
  965.               Count rxMaxBuffer,
  966.               Count rxMinService1,
  967.               Count rxMinService2,
  968.               EnetAddressListPtr addressList,
  969.               Boolean acceptErrors,
  970.               EnetRxISRPtr RxISR,
  971.               void *rxCookie);
  972.  
  973. // EnetDiagnostic() performs diagnostic tests.
  974. // Returns false if there was an error.
  975. extern Boolean EnetDiagnosticTest(EnetPtr);
  976.  
  977. // EnetStatus() composes a status report.
  978. // Call with a NULL BPrintfBuffer pointer to clear the status.
  979. extern void EnetStatus(EnetPtr, BPrintfBufferPtr);
  980.  
  981. // EnetClose() terminates access to the Enet and MAC modules.
  982. // It invalidates the EnetPtr and returns NULL.
  983. // Returns the EnetPtr if there was an error.
  984. // WARNING: If there was an error, then the driver is *NOT* closed!
  985. //          This will happen if any buffers were not returned to the pool.
  986. extern EnetPtr EnetClose(EnetPtr);
  987.  
  988. // EnetOpen() prepares the Enet module for operation.
  989. // Full kernel services must be available.
  990. // The MAC module will be opened.
  991. // Returns a pointer to the allocated Enet structure.
  992. // Returns NULL if there was an error.
  993. extern EnetPtr
  994.     EnetOpen(void *enetCookie,
  995.              char *driverName,
  996.              dle_interface_status_t *iStatus,
  997.              dle_ethernet_status_t *eStatus,
  998.              MPrintfPtr m,
  999.              char **chipName,
  1000.              EnetAddressListPtr *addressList);
  1001.  
  1002. // EnetProbe() tests for the existance of Enet hardware.
  1003. // Returns false if there is no hardware.
  1004. extern Boolean EnetProbe(void *enetCookie, char *driverName);
  1005.  
  1006. // RetrieveSoftEthernetAddress() retrieves the user-specified Ethernet address,
  1007. // if one exists in an 'eadr' resource, or in the Name Registry.
  1008. extern int RetrieveSoftEthernetAddress(RegEntryID *theID, EnetAddress eAddress);
  1009.  
  1010. /******************************************************************************/
  1011.  
  1012. // MacStatus() composes a status report for EnetStatus().
  1013. // Call with a NULL BPrintfBuffer pointer to clear the status.
  1014. typedef void (*MacStatusPtr)(EnetMACPtr, BPrintfPtr);
  1015.  
  1016. // MacTxUnblock() prepares to unblock the transmitter.
  1017. // TxUnblock() is called when enough packets have been sent.
  1018. typedef void
  1019.     (*MacTxUnblockPtr)(EnetMACPtr, EnetTxUnblockPtr TxUnblock, void *);
  1020.  
  1021. // MacTxService() recycles TxBuffers from the TxRing.
  1022. typedef void (*MacTxServicePtr)(EnetMACPtr, TxPacketPtr);
  1023.  
  1024. // MacTxCheck() checks that the transmitter is not broken.
  1025. // Returns false if there was an error.
  1026. typedef Boolean (*MacTxCheckPtr)(EnetMACPtr);
  1027.  
  1028. // MacTxReset() prepares the transmit ring.
  1029. // Returns false if there was an error.
  1030. typedef Boolean (*MacTxResetPtr)(EnetMACPtr, Count maxBuffer);
  1031.  
  1032. // MacTxPacket() transmits normal packets.
  1033. // Returns NULL if the packet will be transmitted or dropped.
  1034. // Returns the packet pointer if blocked.
  1035. typedef TxPacketPtr (*MacTxPacketPtr)(EnetMACPtr, TxPacketPtr);
  1036.  
  1037. // MacTxBadPacket() transmits error packets.
  1038. // Returns NULL if the packet will be transmitted or dropped.
  1039. // Returns the packet pointer if blocked.
  1040. typedef TxPacketPtr (*MacTxBadPacketPtr)(EnetMACPtr, TxPacketPtr, TxErrorFlags);
  1041.  
  1042. // MacRxCheck() checks that the receiver is not broken.
  1043. // Returns false if there was an error.
  1044. typedef Boolean (*MacRxCheckPtr)(EnetMACPtr);
  1045.  
  1046. // MacRxReset() prepares the receive ring.
  1047. // Returns false if there was an error.
  1048. typedef Boolean (*MacRxResetPtr)(EnetMACPtr, Count maxBuffer);
  1049.  
  1050. // MacRxService() fills the RxRing with RxBuffers.
  1051. typedef void (*MacRxServicePtr)(EnetMACPtr mac);
  1052.  
  1053. // MacRxPacket() receives a packet.
  1054. // Returns NULL if blocked.
  1055. typedef RxPacketPtr (*MacRxPacketPtr)(EnetMACPtr);
  1056.  
  1057. // MacStop() stops the transmit and receive processes.
  1058. // Returns false if there was an error.
  1059. typedef Boolean (*MacStopPtr)(EnetMACPtr);
  1060.  
  1061. // MacStart() starts the transmit and receive processes.
  1062. // Returns false if there was an error.
  1063. typedef Boolean
  1064.     (*MacStartPtr)(EnetMACPtr,
  1065.                    EnetMode,
  1066.                    Count timeout,
  1067.                    Count txMinUnblock,
  1068.                    Count txMaxService,
  1069.                    Count rxMinService1,
  1070.                    Count rxMinService2,
  1071.                    UInt32 *connectedSpeed,
  1072.                    EnetAddressListPtr,
  1073.                    Boolean acceptErrors,
  1074.                    EnetRxISRPtr RxISR,
  1075.                    void *rxCookie);
  1076.  
  1077. // MacClose() terminates access to the MAC module.
  1078. // The EnetMACPtr is invalidated.
  1079. // Returns NULL.
  1080. typedef EnetMACPtr (*MacClosePtr)(EnetMACPtr);
  1081.  
  1082. //
  1083. // An EnetMACPtr is the first element of a Enet structure.
  1084. //
  1085. struct EnetMAC
  1086. {
  1087.     MacStatusPtr                MacStatus;
  1088.     MacTxUnblockPtr                MacTxUnblock;
  1089.     MacTxServicePtr                MacTxService;
  1090.     MacTxCheckPtr                MacTxCheck;
  1091.     MacTxResetPtr                MacTxReset;
  1092.     MacTxPacketPtr                MacTxPacket;
  1093.     MacTxBadPacketPtr            MacTxBadPacket;
  1094.     MacRxCheckPtr                MacRxCheck;
  1095.     MacRxResetPtr                MacRxReset;
  1096.     MacRxServicePtr                MacRxService;
  1097.     MacRxPacketPtr                MacRxPacket;
  1098.     MacStopPtr                    MacStop;
  1099.     MacStartPtr                    MacStart;
  1100.     MacClosePtr                    MacClose;
  1101. };
  1102.  
  1103. // MacOpen() prepares the MAC module for operation.
  1104. // Returns a pointer to the allocated EnetMAC structure.
  1105. // Returns NULL if there was an error.
  1106. extern EnetMACPtr
  1107.     MacOpen(void *enetCookie,
  1108.             char *driverName,
  1109.             EnetPtr,
  1110.             dle_ethernet_status_t *,
  1111.             MPrintfPtr,
  1112.             UInt32 *minTxBufferSize,
  1113.             UInt32 *minRxBufferSize,
  1114.             UInt32 *maxPacketSize,
  1115.             char **chipName,
  1116.             EnetAddressListPtr *addressList);
  1117.  
  1118. /******************************************************************************/
  1119.  
  1120. #endif // __ENETLIB_H__
  1121.